<?php

/**
 * JmsTbCar form base class.
 *
 * @method JmsTbCar getObject() Returns the current form's model object
 *
 * @package    jmscargo
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseJmsTbCarForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                => new sfWidgetFormInputHidden(),
      'user_id'           => new sfWidgetFormInputText(),
      'manufacturer_id'   => new sfWidgetFormInputText(),
      'mark_id'           => new sfWidgetFormInputText(),
      'model'             => new sfWidgetFormInputText(),
      'manufactured_year' => new sfWidgetFormInputText(),
      'price'             => new sfWidgetFormInputText(),
      'fuel_id'           => new sfWidgetFormInputText(),
      'engine_cap'        => new sfWidgetFormInputText(),
      'gearbox_id'        => new sfWidgetFormInputText(),
      'condition_id'      => new sfWidgetFormInputText(),
      'joloo'             => new sfWidgetFormInputText(),
      'exterior_color'    => new sfWidgetFormInputText(),
      'cardrive_id'       => new sfWidgetFormInputText(),
      'milage'            => new sfWidgetFormInputText(),
      'picture_id'        => new sfWidgetFormInputText(),
      'cuzowni_angilal'   => new sfWidgetFormInputText(),
      'description'       => new sfWidgetFormTextarea(),
      'create_at'         => new sfWidgetFormInputText(),
      'update_at'         => new sfWidgetFormInputText(),
      'enabled'           => new sfWidgetFormInputText(),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'           => new sfValidatorInteger(),
      'manufacturer_id'   => new sfValidatorInteger(),
      'mark_id'           => new sfValidatorInteger(array('required' => false)),
      'model'             => new sfValidatorString(array('max_length' => 64)),
      'manufactured_year' => new sfValidatorString(array('max_length' => 4, 'required' => false)),
      'price'             => new sfValidatorInteger(),
      'fuel_id'           => new sfValidatorInteger(array('required' => false)),
      'engine_cap'        => new sfValidatorInteger(array('required' => false)),
      'gearbox_id'        => new sfValidatorInteger(array('required' => false)),
      'condition_id'      => new sfValidatorInteger(array('required' => false)),
      'joloo'             => new sfValidatorInteger(array('required' => false)),
      'exterior_color'    => new sfValidatorInteger(array('required' => false)),
      'cardrive_id'       => new sfValidatorInteger(array('required' => false)),
      'milage'            => new sfValidatorInteger(array('required' => false)),
      'picture_id'        => new sfValidatorInteger(array('required' => false)),
      'cuzowni_angilal'   => new sfValidatorString(array('max_length' => 64)),
      'description'       => new sfValidatorString(array('required' => false)),
      'create_at'         => new sfValidatorString(array('max_length' => 255)),
      'update_at'         => new sfValidatorString(array('max_length' => 255)),
      'enabled'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'created_at'        => new sfValidatorDateTime(),
      'updated_at'        => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('jms_tb_car[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'JmsTbCar';
  }

}
